﻿using System.Collections.Generic;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.RepositoryFramework;

namespace Ue.Qcdz.Domain.TheSiteConfig
{
    public class SiteConfigService
    {
        private static ISiteConfigRepository _repository;
        static SiteConfigService()
        {
            _repository = RepositoryFactory.GetRepository<ISiteConfigRepository, SiteConfig>();
        }
        public static SiteConfig GetSiteConfig(object rolesionsKey)
        {
            return SiteConfigService._repository.FindBy(rolesionsKey);
        }
        public static IList<SiteConfig> GetSiteConfig()
        {
            return SiteConfigService._repository.FindAll();
        }
        public static IDataResult<SiteConfig> GetSiteConfig(IDataQuery dataQuery)
        {
            return SiteConfigService._repository.FindBy(dataQuery);
        }
        public static void AddSiteConfig(SiteConfig role)
        {
            SiteConfigService._repository.Add(role);
        }
        public static void UpdateSiteConfig(SiteConfig siteConfig)
        {
            SiteConfigService._repository[siteConfig.Key] = siteConfig;
        }
    }
}
